using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveLightController : MonoBehaviour
{
    public float speed=5;
    public Vector3 target;
    // Start is called before the first frame update
    void Start()
    {
        target=transform.position;
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        float h = 0;
        float v = 0;
        if (Input.GetKey(KeyCode.I))
        {
            v = 1;
        }
        else if (Input.GetKey(KeyCode.K))
        {
            v = -1;
        }

        if (Input.GetKey(KeyCode.J))
        {
            h = 1;
        }
        else if (Input.GetKey(KeyCode.L))
        {
            h = -1;
        }

        target += new Vector3(h, v, 0) * (speed * Time.deltaTime);
        transform.position = Vector3.Lerp(transform.position, target, 0.1f);
    }
}
